package com.longge;

/**
 * @program: my-code
 * @description:
 * @author: longge
 * @create: 2021-02-27 22:38
 */
public class RunningSum {
    public int[] runningSum(int[] nums) {

        int[] res = new int[nums.length];
        res[0]=nums[0];
        for (int i = 1; i < nums.length; i++) {
            res[i] = res[i - 1] + nums[i];
        }
        return nums;
    }
}
